# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=smstools
pkgver=3.1.21
pkgrel=4
_realname="${pkgname}${pkgver%\.[0-9]*\.[0-9]*}"
pkgdesc="SMS Gateway software which can send and receive short messages through GSM modems and mobile phones"
url="http://smstools3.kekekasvi.com/"
arch="all"
license="GPL-2.0-only"
makedepends="$depends_dev"
install=$pkgname.pre-install
options="!check"
subpackages="$pkgname-openrc"
pkgusers="smsd"
pkggroups="smsd"
source="http://smstools3.kekekasvi.com/packages/$_realname-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.conf
	$pkgname.logrotate
	gcc10.patch
	"
builddir="$srcdir"/$_realname

build() {
	make
}

package() {
	install -D -m0755 $builddir/src/smsd $pkgdir/usr/sbin/smsd

	for bin in sendsms sms2html sms2unicode unicode2sms; do
		install -D -m0755 $builddir/scripts/sendsms $pkgdir/usr/bin/$bin
	done

	install -D -m0644 $srcdir/smstools.conf $pkgdir/etc/smsd.conf
	install -D -m0755 $srcdir/smstools.initd $pkgdir/etc/init.d/smsd
	install -D -m0644 $srcdir/smstools.logrotate $pkgdir/etc/logrotate.d/smsd
}

sha512sums="0587e5020a0318351ca99b68baa1c19411824279055857a5b5aa4e346cae373fe94a811eaca6767bcf991cf849eaaa66ec120f046420531a6088cdde9373db31  smstools3-3.1.21.tar.gz
0ea806c9754b96f6e94269c0beb334027f3d4ca50c7afe20ce2145369fd5e4ce88dc43242ec0b5f681209a3d128697c9d624b8ef7e150f856c7559fcca2f5614  smstools.initd
cf2a6d605f49df10d172bc412983312d37b315e42bdb82b2ce27eda4aaaec8526a6548db293457f48aa70b8d911a4169c77682f68850bef4c084b27ca478db9d  smstools.conf
668eed2143c1f08fe1deb27a20496317c77160f3278d68fbc54ac8008c5d266c0a2dc39551fd1ced92706bfffc0bc5ee7581e452670e3bff92837e598b98b10e  smstools.logrotate
81fdbd7822834387e632979cad2951ba7429171f2e733a4ab49e15a29f4ca04983ce36b09043e975ff78d1b2bd346298a176ac885d8a8e1f35688e6a118f5fba  gcc10.patch"
